﻿using System;
using System.Windows;
using Microsoft.Phone.Shell;
using Microsoft.Phone.Controls;

namespace Coco.UX
{
    public class UXApplicationBarIconButton : ApplicationBarIconButton
    {
        public UXApplicationBarIconButton()
        {
            Click += new EventHandler(UXApplicationBarIconButton_Click);
        }

        void UXApplicationBarIconButton_Click(object sender, EventArgs e)
        {
            if (Uri != null)
            {
                PhoneApplicationFrame page = (PhoneApplicationFrame)Application.Current.RootVisual;
                page.Navigate(Uri);
            }
        }

        public Uri Uri { get; set; }
    }
}
